Skip to content

dsh-comfyui: projects, validation and a rung ladder over ComfyUI - #17

Merged
vecnode merged 2 commits into
mainfrom
feat/dsh-comfyui
Nov 28, 2026
Merged

vecnode merged 2 commits into
mainfrom
feat/dsh-comfyui

Conversation

@vecnode

@vecnode vecnode commented Nov 28, 2026

Copy link
Copy Markdown
Owner

What this adds

packages/dsh-comfyui — a host-only bundle (one row, no route, no browser half, zero npm dependencies, no bundled engine) that turns a small readable project spec into the two files ComfyUI actually consumes, checks them, and reports what a run produced.

Seven tools: comfy_status, comfy_nodes, comfy_project, comfy_validate, comfy_run, comfy_test, comfy_cli.
Six skills: the fundamentals, the two workflow dialects, the HTTP API as this install has it, comfy-cli across platforms, authoring a node class, and the project dialect.

The two problems it exists for

1. The unnamed array. A workflow's widgets_values is a positional array of values with no names, and a class that declares control_after_generate inserts an extra value right after itself. Measured on the installed ComfyUI 0.21.1, KSampler.seed has it:

[42, "fixed", 4, 1.5, "lcm", "sgm_uniform", 1.0]
  seed  │      steps cfg sampler scheduler  denoise

A converter that drops index 1 opens a graph whose cfg is 4, whose sampler is 1.5 — and nothing reports it. The compiler derives that array from /object_info, and the check asserts this exact array.

2. Nothing checked the files without a server. /object_info is what turns a dropdown into a file list, so with the app closed a graph naming a 2 GB checkpoint validated "clean". A new file check reads the install (models/<folder>/, input/, plus the extra model roots comfy-cli reports) for any file input whose option list the catalog did not know, and reports value_not_in_list with the folder, the file count and the nearest name. It runs on the compiled prompt, so @bindings are already filenames.

The rung ladder

Every answer names the rung it reached, so "it compiles" is never printed as "it runs":

Rung Means
v1-structural sound against the built-in core table (18 nodes)
v2-schema checked against a complete server catalog
v3-queued /prompt accepted it
v4-executed a /history entry finished and named files

comfy-cli, measured not guessed

Every CLI fact was verified against 1.29.0 on this machine (via a throwaway uvx run, nothing installed):

  • --json is a global flag: comfy --json env. comfy env --json is a usage error (No such option: --json) — the first version of this PR got that wrong.
  • every answer is an envelope {schema, type, ok, command, version, where, data, error}; the payload is under data, the CLI version is top-level, and a refusal carries error.code/message/hint.
  • comfy node deps-in-workflow refuses before reading the graph without a valid workspace ('<path>' is not a valid ComfyUI workspace) and without ComfyUI-Manager — a Desktop install keeps its Manager inside the app. Both sentences are reported in words, and --workspace names the tree comfy_status found so the first refusal is avoided.
  • comfy run --workflow accepts the UI canvas and converts it itself: an independent check on what this package generated.

comfy_cli never runs comfy install, installs a node, downloads a model or removes anything.

Verification

  • node packages/dsh-comfyui/checks/check-comfyui-node.mjs → 364 assertions, 0 failures, live half skipped (no server on this machine). A fake ComfyUI answers the real routes with real-shaped bodies; a fake comfy-cli answers the measured envelopes; the canvas round-trips back to the identical prompt; every refusal is produced by name; the skills' fenced examples are parsed (json/js/python) or checked against the documented routes and subcommands.
  • check-node-routes.mjs, check-scripts.mjs, check-no-secrets.mjs → pass.
  • Run against the real comfy-cli 1.29.0: it reports this machine's actual state (RTX 3090, 24 GiB VRAM, a Desktop install whose folder is gone, Manager not installed) and both failure paths explain themselves.
  • The four examples compile in 3 consecutive check runs with no writes.

Honest limits

  • No graph has been executed against a live server: nothing was listening, and this machine's ComfyUI base path is gone (the Desktop app cannot start as-is). comfy_test action=run and the port-table's live comparison are therefore unproven here; the port table is transcribed from the installed 0.21.1 source and asserted against a fixture, and /object_info replaces it wholesale the moment a server answers.
  • comfy_cli action=deps cannot succeed on a Desktop install (no Manager in the tree) — that is comfy-cli's rule, now reported rather than hidden.

Test plan

node packages/dsh-comfyui/checks/check-comfyui-node.mjs
node scripts/checks/check-node-routes.mjs
node scripts/checks/check-scripts.mjs
node scripts/checks/check-no-secrets.mjs

Then with ComfyUI running: comfy_status → comfy_test action=run examples=["smoke-image","smoke-video"] (neither needs a model) → comfy_project action=new template=text-to-image.

Adds packages/dsh-comfyui, a host-only bundle (one row, no route, no browser
half, zero npm dependencies) that turns a small readable project spec into the
two files ComfyUI actually consumes, checks them, and reports what a run
produced.

Seven tools:

  comfy_status    install / server / catalog / python as four facts that fail
                  independently. Probes 8188 AND the Desktop ports 8000-8003
                  (Desktop does not use 8188). Starts nothing.
  comfy_nodes     the catalog in force - a live /object_info, a cache, or the
                  built-in core table - with each class's input ORDER, which is
                  what widgets_values means.
  comfy_project   new (from a template or an inline spec, rebinding model
                  filenames to this machine's own file lists), list, show,
                  build, import.
  comfy_validate  ComfyUI's own checks offline, with /prompt's error strings
                  (required_input_missing, return_type_mismatch,
                  value_not_in_list, dependency_cycle, prompt_no_outputs, ...)
                  plus the node KEY and input NAME.
  comfy_run       build, refuse a graph with errors, submit, wait for /history,
                  report files with /view URLs and their path on disk - or the
                  node that raised.
  comfy_test      the ladder over the shipped library: compile always (writes
                  nothing), run when a server answers.
  comfy_cli       comfy-cli as a SECOND test path: comfy run --workflow (it
                  converts the canvas itself), node deps-in-workflow, launch
                  --background, stop. Never installs anything.

The reason it exists is one trap and one gap:

  * widgets_values is an UNNAMED positional array, and a class declaring
    control_after_generate inserts an extra value right after itself. Measured
    on ComfyUI 0.21.1, KSampler.seed has it, so its array is
    [42, "fixed", 4, 1.5, "lcm", "sgm_uniform", 1.0]. A converter that drops
    index 1 opens a graph whose cfg, sampler and scheduler are all shifted, and
    nothing reports it. The compiler derives that array from /object_info and
    the package check asserts it.
  * with no server nothing checked that a graph's checkpoint exists. A new
    file check reads the INSTALL (models/<folder>/, input/, comfy-cli's extra
    model roots) for any file input whose option list the catalog did not know,
    and reports value_not_in_list with the folder, the file count and the
    nearest name - so v1-structural on a machine whose models are present is a
    claim somebody made.

Every answer names the rung it reached: v1-structural (core table),
v2-schema (a complete server catalog), v3-queued, v4-executed.

Four examples (two need no model at all, so a new machine proves the queue
before a download), six skills (the fundamentals, the two workflow dialects,
the HTTP API as this install has it, comfy-cli across platforms, authoring a
node class, the project dialect), and a package check of 364 assertions that
needs neither a server nor a CLI: a fake ComfyUI answers the real routes with
real-shaped bodies, a fake comfy-cli answers the measured 1.29.0 envelopes, the
canvas round-trips back to the identical prompt, and every refusal is produced
by name.

comfy-cli facts were measured, not guessed, against 1.29.0: --json is a GLOBAL
flag (comfy --json env; comfy env --json is a usage error), every answer is an
envelope with the payload under data, and node deps-in-workflow refuses without
a valid workspace and ComfyUI-Manager - both sentences are reported instead of
raw stderr, and --workspace names the tree comfy_status found.

Checks run: node packages/dsh-comfyui/checks/check-comfyui-node.mjs (364, 0
failures, the live half skipped - no server here), check-node-routes.mjs,
check-scripts.mjs, check-no-secrets.mjs.
@vecnode
vecnode merged commit 97e9f71 into main Nov 28, 2026
2 checks passed
@vecnode
vecnode deleted the feat/dsh-comfyui branch November 28, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant